﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MadLibrary.Net.Client
{
    /// <summary>
    /// Contains response data.
    /// </summary>
    public class Response
    {
        /// <summary>
        /// Holds response message.
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// Holds time of response receivation.
        /// </summary>
        public DateTime Time { get; set; }
        /// <summary>
        /// Creates new empty response.
        /// </summary>
        public Response()
        {
            this.Message = "";
            this.Time = DateTime.Now;
        }
        /// <summary>
        /// Creates new response object instance with specified response data.
        /// </summary>
        /// <param name="ResponseData">Specifies response data.</param>
        public Response(string ResponseData)
        {
            Message = ResponseData;
            Time = DateTime.Now;
        }
        /// <summary>
        /// Creates new response with response data and receivation time specified.
        /// </summary>
        /// <param name="ResponseData">Specifies response data.</param>
        /// <param name="ReceivationTime">Specifies requests' receivation time.</param>
        public Response(string ResponseData, DateTime ReceivationTime)
        {
            Message = ResponseData;
            Time = ReceivationTime;
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return this.Time.ToString() + ": " + this.Message;
        }
    }
    /// <summary>
    /// Contains request data.
    /// </summary>
    public class Request
    {
        /// <summary>
        /// Gets or sets request message.
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// Gets or sets request time.
        /// </summary>
        public DateTime Time { get; set; }
        /// <summary>
        /// Creates new empty request.
        /// </summary>
        public Request()
        {
            this.Message = "";
            this.Time = DateTime.Now;
        }
        /// <summary>
        /// Creates new request with specified data.
        /// </summary>
        /// <param name="RequestData">Specifies request data.</param>
        public Request(string RequestData)
        {
            this.Message = RequestData;
            this.Time = DateTime.Now;
        }
        /// <summary>
        /// Creates new request with specified data and associates request time.
        /// </summary>
        /// <param name="RequestData">Specifies request data.</param>
        /// <param name="RequesTime">Specifies request time.</param>
        public Request(string RequestData, DateTime RequesTime)
        {
            this.Message = RequestData;
            this.Time = RequesTime;
        }

        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            return this.Time.ToString() + ": " + this.Message;
        }
    }
}
